SOURCES = Entry.o lua_wrapper.o  TracingThreadCntr.o  TracingThread.o \
          ./base/basic_types.o   ./base/color.o \
          ./base/BitmapObject.o  ./base/geometry.o \
          ./intersection/EyeRayGen.o           ./intersection/intersect_ray_tri.o \
          ./intersection/intersect_ray_bbox.o  ./intersection/intersect_tri_bbox.o \
          ./math/Matnnt.o  ./math/Quatt.o  ./math/Trafo.o \
          ./camera/camera_manager.o  ./camera/pinhole_camera.o \
          ./camera/DOF_camera.o \
          ./os/api_wrapper.o \
          ./file_io/KObjFileLoader.o \
          ./file_io/glm.o \
          ./sampling/eye_ray_samp.o  ./sampling/sampler_manager.o \
          ./sampling/fast_pd_samp.o  ./sampling/spherical_pd_samp.o \
          ./sampling/pd_samp_base.o  ./sampling/stratified_samp.o \
          ./sampling/pd_sampling/PDSampling.o  ./sampling/pd_sampling/RNG.o \
          ./sampling/pd_sampling/RangeList.o   ./sampling/pd_sampling/ScallopedSector.o \
          ./scene/KKDBBoxScene.o  ./scene/KKDTreeScene.o \
          ./shader/light_scheme.o  ./shader/surface_shader.o \
          ./texture/basic_map.o  ./texture/txfilt.o \
          ./util/HelperFunc.o      ./util/thread_model.o     ./util/unique_string.o \
          ./util/mem_block_list.o  ./util/tile2d.o \
          ./util/memory_pool.o     ./util/triangle_filter.o \
          ./gi_solver/irradiance_cache.o  ./gi_solver/point_light_photon.o \
          ./gi_solver/photon_emitter.o    ./gi_solver/VPL_shading.o \
          ./material/material_library.o  ./material/standard_mtl.o


CFLAGS =  -c -Wno-deprecated -mssse3 \
          -O2 -finline-functions

CC = g++

all : KRayTracer


%.o : %.cpp
	$(CC) $(CFLAGS) $< -o $@
%.o : %.c
	$(CC) $(CFLAGS) $< -o $@

KSlowrt : $(SOURCES)
	$(CC) -lm -lpthread -lIL -llua5.1 -lILU $(SOURCES) -o $@

Entry.o                         : ./Entry.cpp
lua_wrapper.o                   : ./lua_wrapper.cpp
TracingThreadCntr.o             : ./TracingThreadCntr.cpp
TracingThread.o                 : ./TracingThread.cpp
./base/basic_types.o                   : ./base/basic_types.cpp   
./base/color.o                         : ./base/color.cpp 
./base/BitmapObject.o                  : ./base/BitmapObject.cpp  
./base/geometry.o                      : ./base/geometry.cpp 
./intersection/EyeRayGen.o                     : ./intersection/EyeRayGen.cpp 
./intersection/intersect_ray_tri.o             : ./intersection/intersect_ray_tri.cpp 
./intersection/intersect_ray_bbox.o            : ./intersection/intersect_ray_bbox.cpp  
./intersection/intersect_tri_bbox.o            : ./intersection/intersect_tri_bbox.cpp 
./math/Matnnt.o                        : ./math/Matnnt.cpp  
./math/Quatt.o                         : ./math/Quatt.cpp  
./math/Trafo.o                         : ./math/Trafo.cpp 
./os/api_wrapper.o                     : ./os/api_wrapper.cpp
./file_io/KObjFileLoader.o             : ./file_io/KObjFileLoader.cpp
./file_io/glm.o                        : ./file_io/glm.c
./camera/camera_manager.o                : ./camera/camera_manager.cpp  
./camera/pinhole_camera.o                : ./camera/pinhole_camera.cpp
./camera/DOF_camera.o                    : ./camera/DOF_camera.cpp 
./sampling/eye_ray_samp.o                  : ./sampling/eye_ray_samp.cpp  
./sampling/sampler_manager.o               : ./sampling/sampler_manager.cpp
./sampling/fast_pd_samp.o                  : ./sampling/fast_pd_samp.cpp  
./sampling/spherical_pd_samp.o             : ./sampling/spherical_pd_samp.cpp 
./sampling/pd_samp_base.o                  : ./sampling/pd_samp_base.cpp  
./sampling/stratified_samp.o               : ./sampling/stratified_samp.cpp 
./sampling/pd_sampling/PDSampling.o        : ./sampling/pd_sampling/PDSampling.cpp
./sampling/pd_sampling/RNG.o               : ./sampling/pd_sampling/RNG.cpp
./sampling/pd_sampling/RangeList.o         : ./sampling/pd_sampling/RangeList.cpp
./sampling/pd_sampling/ScallopedSector.o   : ./sampling/pd_sampling/ScallopedSector.cpp
./scene/KKDBBoxScene.o                  : ./scene/KKDBBoxScene.cpp  
./scene/KKDTreeScene.o                  : ./scene/KKDTreeScene.cpp 
./shader/light_scheme.o                  : ./shader/light_scheme.cpp  
./shader/surface_shader.o                : ./shader/surface_shader.cpp
./texture/basic_map.o                     : ./texture/basic_map.cpp  
./texture/txfilt.o                        : ./texture/txfilt.cpp 
./util/HelperFunc.o                    : ./util/HelperFunc.cpp     
./util/thread_model.o                  : ./util/thread_model.cpp     
./util/unique_string.o                 : ./util/unique_string.cpp 
./util/mem_block_list.o                : ./util/mem_block_list.cpp  
./util/tile2d.o                        : ./util/tile2d.cpp
./util/memory_pool.o                   : ./util/memory_pool.cpp    
./util/triangle_filter.o               : ./util/triangle_filter.cpp 
./gi_solver/irradiance_cache.o              : ./gi_solver/irradiance_cache.cpp  
./gi_solver/point_light_photon.o            : ./gi_solver/point_light_photon.cpp 
./gi_solver/photon_emitter.o                : ./gi_solver/photon_emitter.cpp    
./gi_solver/VPL_shading.o                   : ./gi_solver/VPL_shading.cpp
./material/material_library.o              : ./material/material_library.cpp  
./material/standard_mtl.o                  : ./material/standard_mtl.cpp


clean :
	-rm ./*.o
	-rm ./base/*.o
	-rm ./intersection/*.o
	-rm ./math/*.o
	-rm ./camera/*.o
	-rm ./sampling/*.o
	-rm ./scene/*.o
	-rm ./shader/*.o
	-rm ./texture/*.o
	-rm ./util/*.o
	-rm ./gi_solver/*.o
	-rm ./material/*.o
